<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="searchconsole_v1.html">Google Search Console API</a> . <a href="searchconsole_v1.searchanalytics.html">searchanalytics</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#query">query(siteUrl, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="query">query(siteUrl, body=None, x__xgafv=None)</code>
  <pre>Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.

Args:
  siteUrl: string, The site&#x27;s URL, including protocol. For example: `http://www.example.com/`. (required)
  body: object, The request body.
    The object takes the form of:

{
  &quot;aggregationType&quot;: &quot;A String&quot;, # [Optional; Default is \&quot;auto\&quot;] How data is aggregated. If aggregated by property, all data for the same property is aggregated; if aggregated by page, all data is aggregated by canonical URI. If you filter or group by page, choose AUTO; otherwise you can aggregate either by property or by page, depending on how you want your data calculated; see the help documentation to learn how data is calculated differently by site versus by page. **Note:** If you group or filter by page, you cannot aggregate by property. If you specify any value other than AUTO, the aggregation type in the result will match the requested type, or if you request an invalid type, you will get an error. The API will never change your aggregation type if the requested type is invalid.
  &quot;dataState&quot;: &quot;A String&quot;, # The data state to be fetched, can be full or all, the latter including full and partial data.
  &quot;dimensionFilterGroups&quot;: [ # [Optional] Zero or more filters to apply to the dimension grouping values; for example, &#x27;query contains \&quot;buy\&quot;&#x27; to see only data where the query string contains the substring \&quot;buy\&quot; (not case-sensitive). You can filter by a dimension without grouping by it.
    { # A set of dimension value filters to test against each row. Only rows that pass all filter groups will be returned. All results within a filter group are either AND&#x27;ed or OR&#x27;ed together, depending on the group type selected. All filter groups are AND&#x27;ed together.
      &quot;filters&quot;: [
        { # A filter test to be applied to each row in the data set, where a match can return the row. Filters are string comparisons, and values and dimension names are not case-sensitive. Individual filters are either AND&#x27;ed or OR&#x27;ed within their parent filter group, according to the group&#x27;s group type. You do not need to group by a specified dimension to filter against it.
          &quot;dimension&quot;: &quot;A String&quot;,
          &quot;expression&quot;: &quot;A String&quot;,
          &quot;operator&quot;: &quot;A String&quot;,
        },
      ],
      &quot;groupType&quot;: &quot;A String&quot;,
    },
  ],
  &quot;dimensions&quot;: [ # [Optional] Zero or more dimensions to group results by. Dimensions are the group-by values in the Search Analytics page. Dimensions are combined to create a unique row key for each row. Results are grouped in the order that you supply these dimensions.
    &quot;A String&quot;,
  ],
  &quot;endDate&quot;: &quot;A String&quot;, # [Required] End date of the requested date range, in YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal to the start date. This value is included in the range.
  &quot;rowLimit&quot;: 42, # [Optional; Default is 1000] The maximum number of rows to return. Must be a number from 1 to 25,000 (inclusive).
  &quot;searchType&quot;: &quot;A String&quot;, # [Optional; Default is \&quot;web\&quot;] The search type to filter for.
  &quot;startDate&quot;: &quot;A String&quot;, #  [Required] Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or equal to the end date. This value is included in the range.
  &quot;startRow&quot;: 42, # [Optional; Default is 0] Zero-based index of the first row in the response. Must be a non-negative number.
  &quot;type&quot;: &quot;A String&quot;, # Optional. [Optional; Default is \&quot;web\&quot;] Type of report: search type, or either Discover or Gnews.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter.
  &quot;metadata&quot;: { # An object that may be returned with your query results, providing context about the state of the data. When you request recent data (using `all` or `hourly_all` for `dataState`), some of the rows returned may represent data that is incomplete, which means that the data is still being collected and processed. This metadata object helps you identify exactly when this starts and ends. All dates and times provided in this object are in the `America/Los_Angeles` time zone. The specific field returned within this object depends on how you&#x27;ve grouped your data in the request. See details in inner fields. # An object that may be returned with your query results, providing context about the state of the data. See details in Metadata object documentation.
    &quot;firstIncompleteDate&quot;: &quot;A String&quot;, # The first date for which the data is still being collected and processed, presented in `YYYY-MM-DD` format (ISO-8601 extended local date format). This field is populated only when the request&#x27;s `dataState` is &quot;`all`&quot;, data is grouped by &quot;`DATE`&quot;, and the requested date range contains incomplete data points. All values after the `first_incomplete_date` may still change noticeably.
    &quot;firstIncompleteHour&quot;: &quot;A String&quot;, # The first hour for which the data is still being collected and processed, presented in `YYYY-MM-DDThh:mm:ss[+|-]hh:mm` format (ISO-8601 extended offset date-time format). This field is populated only when the request&#x27;s `dataState` is &quot;`hourly_all`&quot;, data is grouped by &quot;`HOUR`&quot; and the requested date range contains incomplete data points. All values after the `first_incomplete_hour` may still change noticeably.
  },
  &quot;responseAggregationType&quot;: &quot;A String&quot;, # How the results were aggregated.
  &quot;rows&quot;: [ # A list of rows grouped by the key values in the order given in the query.
    {
      &quot;clicks&quot;: 3.14,
      &quot;ctr&quot;: 3.14,
      &quot;impressions&quot;: 3.14,
      &quot;keys&quot;: [
        &quot;A String&quot;,
      ],
      &quot;position&quot;: 3.14,
    },
  ],
}</pre>
</div>

</body></html>